package com.me.bbs.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.me.bbs.dto.CommentDTO;
import com.me.bbs.dto.SubCommentDTO;
import com.me.bbs.entity.Comment;
import com.baomidou.mybatisplus.extension.service.IService;
import com.me.bbs.vo.CommentVO;

import java.sql.SQLException;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author lm
 * @since 2023-01-09
 */
public interface ICommentService extends IService<Comment> {

    Long saveOne(CommentVO commentVO) throws SQLException;

    Page<CommentDTO> getByPostInPage(Page<CommentDTO> page, Long postId, Long cid);

    CommentDTO getCommentById(Long id);

    SubCommentDTO getCommentById(Long id, boolean isSub);

    void deleteByCid(Long id) throws SQLException;

    Page<Map<String, Object>> getLatestComments(Page<Comment> page, Map<String ,Object> argsMap);

    Long getUnreadCount(Map<String ,Object> argsMap);
}
